/**
 * Created by Administrator on 2017/4/9 0009.
 */
var Page0={
    create:function () {
        var page={};

        page.ui=new PIXI.DisplayObjectContainer();

        var bg=new PIXI.Graphics();
        bg.beginFill(0,1);
        bg.drawRect(0,0,740,1136);
        bg.endFill();
        page.ui.addChild(bg);

        var i0=Easy.CreateSprite('assets/images/p0_i0.png',68,88,0.5,0.5,1);
        page.ui.addChild(i0);
        var i1=Easy.CreateSprite('assets/images/p0_i1.png',378,457,0.5,0.5,1);
        page.ui.addChild(i1);
        TweenMax.to(i1,5,{yoyo:true,repeat:-1,x:288,y:555,ease:Cubic.easeInOut});
        var i2=Easy.CreateSprite('assets/images/p0_i2.png',606,672,0.5,0.5,1);
        page.ui.addChild(i2);
        TweenMax.to(i2,2,{yoyo:true,repeat:-1,x:642,y:634,ease:Cubic.easeInOut});
        var t0=Easy.CreateSprite('assets/images/p0_t0.png',364,415,0.5,0.5,1);
        page.ui.addChild(t0);
        var t1=Easy.CreateSprite('assets/images/p0_t1.png',367,413,0.5,0.5,1);
        page.ui.addChild(t1);
        var t2=Easy.CreateSprite('assets/images/p0_t2.png',365,955,0.5,0.5,1);
        page.ui.addChild(t2);
        var tip0=Easy.CreateSprite('assets/images/tip0.png',370,1100,0.5,0.5,1);
        page.ui.addChild(tip0);
        TweenMax.to(tip0,0.7,{yoyo:true,repeat:-1,y:1110,ease:Cubic.easeInOut});

        // var logo=Easy.CreateSprite('assets/images/logo.png',689,1024,0.5,0.5,1);
        // page.ui.addChild(logo);

        page.In=function () {
            t0.alpha=0;
            TweenMax.to(t0,1,{delay:0.5,alpha:1,ease:Cubic.easeInOut});

            t1.alpha=0;
            TweenMax.to(t1,1,{delay:0,alpha:1,ease:Cubic.easeInOut});

            t2.alpha=0;
            TweenMax.to(t2,1,{delay:1,alpha:1,ease:Cubic.easeInOut});

            // logo.alpha=0;
            // TweenMax.to(logo,1,{delay:1.5,alpha:1,ease:Cubic.easeInOut});
        }
        page.Out=function () {
            TweenMax.killTweensOf(t0);
            TweenMax.killTweensOf(t1);
            TweenMax.killTweensOf(t2);
            // TweenMax.killTweensOf(logo);

            TweenMax.to(page.ui,0.3,{alpha:0,onComplete:function () {
                page.ui.alpha=1;
                t0.alpha=0;
                t1.alpha=0;
                t2.alpha=0;
            }})
        }

        return page;
    }
}